﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Perceiveit.Xml.Converters
{
    #region public class BoolXConverter : XConverter<bool>

    public class BoolXConverter : XConverter<bool>
    {
        public override bool FromString(string value)
        {
            bool b;
            if (string.IsNullOrEmpty(value) || !bool.TryParse(value, out b))
                b = false;

            return b;
        }

        public override string ToString(bool value)
        {
            return value.ToString();
        }
    }

    #endregion
}
